package fr.inserm.u674.chcdbweb.model.DTO;

import java.util.Date;

public abstract class TissueManipulation {

	private Long manipulationID;
	private User experimenter;
	private Date manipulationDate;
	private Tissue tissueManipulated;
	private String quantityTissueLeftAfterManipulation;
	
	public TissueManipulation(){}
	
	public TissueManipulation(Long manipulationID){
		this.manipulationID = manipulationID;
	}

	public Long getManipulationID() {
		return manipulationID;
	}

	public void setManipulationID(Long manipulationID) {
		this.manipulationID = manipulationID;
	}

	public User getExperimenter() {
		return experimenter;
	}

	public void setExperimenter(User experimenter) {
		this.experimenter = experimenter;
	}

	public Date getManipulationDate() {
		return manipulationDate;
	}

	public void setManipulationDate(Date manipulationDate) {
		this.manipulationDate = manipulationDate;
	}

	public Tissue getTissueManipulated() {
		return tissueManipulated;
	}

	public void setTissueManipulated(Tissue tissueManipulated) {
		this.tissueManipulated = tissueManipulated;
	}

	public String getQuantityTissueLeftAfterManipulation() {
		return quantityTissueLeftAfterManipulation;
	}

	public void setQuantityTissueLeftAfterManipulation(String quantityTissueLeftAfterManipulation) {
		this.quantityTissueLeftAfterManipulation = quantityTissueLeftAfterManipulation;
	}

	public boolean equals(Object obj) {
		if (obj instanceof TissueManipulation
			&& ((TissueManipulation) obj).getManipulationID().equals(getManipulationID()))
			return true;
		else
			return false;
	}

	@Override
	public int hashCode() {
		if (getManipulationID() != null)
			return this.getClass().hashCode() + getManipulationID().hashCode();
		return super.hashCode();
	}

	@Override
	public String toString() {
		return tissueManipulated + " " + manipulationDate + " " + experimenter;
	}

}
